import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'
import Welcome from '@/views/welcome/Welcome.vue'
import User from '@/views/user/User.vue'
import Org from '@/views/org/Org.vue'
import Menu from '@/views/menu/Menu.vue'
import Role from '@/views/role/Role.vue'
Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect: { path: '/welcome' },
      children: [
        {
          name: 'Welcome',
          path: 'welcome',
          component: Welcome
        }, {
          name: 'Users',
          path: 'user',
          component: User
        }, {
          name: 'Org',
          path: 'org',
          component: Org
        }, {
          name: 'Menu',
          path: 'menu',
          component: Menu
        }, {
          name: 'Role',
          path: 'role',
          component: Role
        }
      ]
    }
  ]
})
